package com.work.model.builder;

import java.util.Date;

import com.work.model.Project;

/**
 * The Class ProjectBuilder.
 *
 * @author "Mihai Roman"
 */
public class ProjectBuilder extends Builder<Project>{
	
	/**
	 * With code freeze.
	 *
	 * @param codeFreeze the code freeze
	 * @return the project builder
	 */
	private ProjectBuilder withCodeFreeze(Date codeFreeze) {
		build().setCodeFreeze(codeFreeze);
		return this;
	}
	
	/**
	 * With created date.
	 *
	 * @param created_Date the created_ date
	 * @return the project builder
	 */
	private ProjectBuilder withCreatedDate(Date created_Date) {
		build().setCreatedDate(created_Date);
		return this;
	}
	
	/**
	 * With domain.
	 *
	 * @param domain the domain
	 * @return the project builder
	 */
	private ProjectBuilder withDomain(String domain) {
		build().setDomain(domain);
		return this;
	}	
	
	/**
	 * With id projects.
	 *
	 * @param idProjects the id projects
	 * @return the project builder
	 */
	private ProjectBuilder withIdProjects(int idProjects) {
		build().setIdProjects(idProjects);
		return this;
	}
	
	/**
	 * With name.
	 *
	 * @param projectName the project name
	 * @return the project builder
	 */
	private ProjectBuilder withName(String projectName) {
		build().setName(projectName);
		return this;
	}		
	
	/**
	 * With start date.
	 *
	 * @param start_Date the start_ date
	 * @return the project builder
	 */
	private ProjectBuilder withStartDate(Date start_Date) {
		build().setStartDate(start_Date);
		return this;
	}
	
	/**
	 * With updated date.
	 *
	 * @param updated_Date the updated_ date
	 * @return the project builder
	 */
	private ProjectBuilder withUpdatedDate(Date updated_Date) {
		build().setUpdatedDate(updated_Date);
		return this;
	}
	
	/**
	 * A project.
	 *
	 * @param codeFreeze the code freeze
	 * @param created_By the created_ by
	 * @param created_Date the created_ date
	 * @param domain the domain
	 * @param idProjects the id projects
	 * @param projectName the project name
	 * @param pm the pm
	 * @param start_Date the start_ date
	 * @param updated_By the updated_ by
	 * @param updated_Date the updated_ date
	 * @return the project
	 */
	public Project aProject(Date codeFreeze, int created_By, Date created_Date, String domain, int idProjects, String projectName, int pm, Date start_Date, int updated_By, Date updated_Date) {
		this.withCodeFreeze(codeFreeze);
		this.withCreatedDate(created_Date);
		this.withDomain(domain);
		this.withIdProjects(idProjects);
		this.withName(projectName);
		this.withStartDate(start_Date);
		this.withUpdatedDate(updated_Date);
		return this.build();
	}
}
